home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 22 / PC Actual CD 22.iso / progs / Netobj / netobj / t2.z / ExternalPictureComp.nfx (.txt) < prev    next >
Encoding:
Java Class File  |  1997-04-29  |  2.0 KB  |  65 lines

  1. public class ExternalPictureComp extends ComponentApp {
  2.    DDrawPicture cdp;
  3.    String theSource;
  4.    String codebase;
  5.    DAssetManager assetMan;
  6.  
  7.    public String PropertyListener(String var1, String var2, int var3, int var4, IDInspector var5) {
  8.       if (var3 == 1) {
  9.          if (var1.compareTo("Image URL") == 0) {
  10.             return this.theSource;
  11.          }
  12.       } else {
  13.          if (var1.compareTo("Image URL") == 0) {
  14.             this.theSource = var2;
  15.             if (this.theSource.indexOf(":") <= 0) {
  16.                this.theSource = "http://" + this.theSource;
  17.             }
  18.          }
  19.  
  20.          this.cdp.setHTMLBefore("<img src=\"" + this.theSource + "\"><!--");
  21.          this.cdp.setHTMLAfter("-->");
  22.          this.cdp.setPictureText(this.theSource);
  23.          this.cdp.Invalidate(true);
  24.       }
  25.  
  26.       return "";
  27.    }
  28.  
  29.    public void onCopy() {
  30.    }
  31.  
  32.    public String onInstall(DAssetManager var1, String var2) {
  33.       this.assetMan = var1;
  34.       this.codebase = var2;
  35.       return "Picture Loader";
  36.    }
  37.  
  38.    protected void finalize() {
  39.    }
  40.  
  41.    public void onUnInstall(DAssetManager var1) {
  42.    }
  43.  
  44.    public void onPublish(DAssetManager var1, int var2) {
  45.    }
  46.  
  47.    public void onDrop(IDLayout var1, IDRect var2, int var3) {
  48.       if (var3 == 1) {
  49.          this.theSource = "";
  50.          this.cdp = new DDrawPicture();
  51.          this.cdp.SetPositionRect(var2.getLeft(), var2.getTop(), var2.getRight(), var2.getBottom());
  52.          this.cdp.setStretch(2);
  53.          this.cdp.setUsePictureText(true);
  54.          this.cdp.setPictureText("Picture Loader");
  55.          this.cdp.setImageFile(this.codebase + "ExternalPictureComp.gif");
  56.          var1.AddObject(this.cdp);
  57.       }
  58.    }
  59.  
  60.    public void onInspect(CStringArray var1, CStringArray var2) {
  61.       var1.Set("Image URL");
  62.       var2.Set("String\u0000");
  63.    }
  64. }
  65.